#include "DrainageFactory.h"

DrainageFactory::DrainageFactory(void)
{
	this->factoryUtil = new FactoryUtil();
}

DrainageFactory::~DrainageFactory(void)
{
	delete(this->factoryUtil);
}

Element* DrainageFactory::createElement(XMLElement* element)
{
	return this->createDrainage(element);
}

Drainage* DrainageFactory::createDrainage(XMLElement* element)
{
	Drainage* drainage = new Drainage();

	string id = this->factoryUtil->buildId(element);
	drainage->setId(id);
	
	Position* position = this->factoryUtil->buildDrainagePosition(element);
	drainage->setPosition(position);

	float radius = this->factoryUtil->buildDrainageRadius(element);
	drainage->setRadius(radius);

	return drainage;
}